﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Description;
using System.ServiceModel.Syndication;
using System.Text;

namespace Microsoft.SqlCommunity.SQLRSS
{
    // The very simple interface for our database changes syndication feed
    // rssFormat should either be "atom" or "rss", connection should match the logical name for the connection in the XML configuration file
    // and table should be the name of the table from which you want to see the changes.
    // NOTE: If you change the interface name "IRSSData" here, you must also update the reference to "IRSSData" in Web.config.
    [ServiceContract]
    [ServiceKnownType(typeof(Atom10FeedFormatter))]
    [ServiceKnownType(typeof(Rss20FeedFormatter))]
    public interface IRSSData
    {
        [OperationContract]
        [WebGet(UriTemplate = "GetDataChanges?rssformat={rssFormat}&connection={connection}&table={table}")]
        SyndicationFeedFormatter GetDataChanges(string rssFormat, string connection, string table);
    }
}
